#pragma once

enum{
    ZERODIVERROR = 1,
    CHARERROR
};

template<class T>
class Task{
    public:
    Task(T a,T b,char ch):_a(a),_b(b),_ch(ch)
    {}
    Task(){}
    ~Task()
    {}
    int calculator(T& ret){
        int flag = 0;
        switch (_ch)
        {
        case '+':
            ret = _a+_b;
            break;
        case '-':
            ret = _a-_b;
            break;
        case '*':
            ret = _a*_b;
            break;
        case '/':
            if(_b != 0)
                ret = _a/_b;
            else
                flag = ZERODIVERROR;
            break;
        default:
            flag = CHARERROR;
            break;
        }
        return flag;
    }
    public:
    T _a;
    T _b;
    char _ch;
};